Skip to content

Add. Decode reserved bits in header.#55

Open
moteus wants to merge 2 commits into
lipp:masterfrom
moteus:decode-reserved-bits
Open

Add. Decode reserved bits in header.#55
moteus wants to merge 2 commits into
lipp:masterfrom
moteus:decode-reserved-bits

Conversation

@moteus

@moteus moteus commented Feb 27, 2015

Copy link
Copy Markdown
Contributor

No description provided.

@lipp

lipp commented Feb 27, 2015

Copy link
Copy Markdown
Owner

why should we read out the reserved if they carry no info at all?

@moteus

moteus commented Feb 27, 2015

Copy link
Copy Markdown
Contributor Author

SV1, RSV2, RSV3: 1 bit each

  MUST be 0 unless an extension is negotiated that defines meanings
  for non-zero values.  If a nonzero value is received and none of
  the negotiated extensions defines the meaning of such a nonzero
  value, the receiving endpoint MUST _Fail the WebSocket
  Connection_.
  1. Implementation must check this to complain rfc
  2. It ma be set(I do not kno how yet)
  3. It needed to pass autobahn test(test case 3)

@lipp

lipp commented Feb 27, 2015

Copy link
Copy Markdown
Owner

ok. but this implementation does not support extensions yet. further, we are not processing the rsv values... how can the autobahn test suite check this?

@moteus

moteus commented Feb 27, 2015

Copy link
Copy Markdown
Contributor Author

Autobahn server send messages with setted rsv and client must close connection with 1002 status

@lipp

lipp commented Feb 27, 2015

Copy link
Copy Markdown
Owner

Ok. I don't see that the connection is closed when rsv != 0. Can we add this test to the Travis file?

@moteus

moteus commented Feb 27, 2015

Copy link
Copy Markdown
Contributor Author

May be we can use autobahn server. The only problem is I do not know how detect test fail.
To run testcase for RSV you can use wstest -m fuzzingserver -s rsv-config.json with config like

{
   "url": "ws://127.0.0.1:9001",
   "outdir": "./reports/clients",
   "cases": ["3.*"],
   "exclude-cases": [],
   "exclude-agent-cases": {}
}

My test runner is https://github.com/moteus/lua-lluv-websocket/blob/master/test/autobahn_client_test.lua

@lipp

lipp commented Feb 27, 2015

Copy link
Copy Markdown
Owner

interesting. i'd like to integrate that somehow.

anyways, shouldn't there be a check for rsv bytes and eventually a connection close?

@moteus

moteus commented Feb 27, 2015

Copy link
Copy Markdown
Contributor Author

shouldn't there be a check for rsv bytes and eventually a connection close?

websocket implementation should check RSV and if it not 0 then it should start close handshake with status 1002.
I do not know how extensions works but it is valid for client without extenstions.
So my lluv websocket in this case send protocol error and return WEBSOCKET.EOF error to client code. So this logic need to be inplemented in client/server code.
Current implementation do not do this and it could work in real world but to provide ability to fix this websockets-core part should returns this bits.

@moteus

moteus commented Feb 28, 2015

Copy link
Copy Markdown
Contributor Author

I just make commit to run autobahn tests on Travis for lluv-websocket. Without this PR tests 3.* are failed.

@lipp

lipp commented Mar 5, 2015

Copy link
Copy Markdown
Owner

👍

but still: we should integrate that test using the "official" api and auto-close the connection as you do in your lluv autobahn test client.

@moteus

moteus commented Mar 6, 2015

Copy link
Copy Markdown
Contributor Author

Please take a look to autobahn_wclient_test. It uses pablic client API.
You just need remove SSL parts and replace uv.run() call.
To run test you need first run run wstest
wstest -m fuzzingserver -s rsv-config.json with config like

{
   "url": "ws://127.0.0.1:9001",
   "outdir": "./reports/clients",
   "cases": ["3.*"],
   "exclude-cases": [],
   "exclude-agent-cases": {}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants